package easy;

public class test17 {
    public static void main(String[] args) {
        test17 test17 = new test17();
        System.out.println(test17.minimumChairs("EEEEEELELLLE"));
    }

    public int minimumChairs(String s) {
        int max = 0, a = 0;
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) == 'E') {
                a++;
                max = Math.max(max, a);
            } else {
                a--;
            }
        }
        return max;
    }
}
